---
title: Spec - howl.ui.CompletionPopup
tags: spec
---
<div class="spec-group spec-group-1">

<h1 id="howl.ui.completionpopup">howl.ui.CompletionPopup</h1>
<div class="spec-group spec-group-2">

<h3 id="(resource-management)">(resource management)</h3>

<pre class="highlight moonscript"><code><span class="n">editor</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">Editor</span><span class="w"> </span><span class="nc">Buffer</span><span class="o">!</span></code></pre>


<h4 id="popups-are-collected-as-they-should">popups are collected as they should</h4>

<pre class="highlight moonscript"><code><span class="n">o</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nc">CompletionPopup</span><span class="w"> </span><span class="n">editor</span><span class="w">
</span><span class="n">list</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">setmetatable</span><span class="w"> </span><span class="p">{</span><span class="n">o</span><span class="p">},</span><span class="w"> </span><span class="ss">__mode:</span><span class="w"> </span><span class="s1">'v'</span><span class="w">
</span><span class="n">o</span><span class="o">\</span><span class="n">destroy</span><span class="o">!</span><span class="w">
</span><span class="n">o</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">nil</span><span class="w">
</span><span class="nb">collectgarbage</span><span class="o">!</span><span class="w">
</span><span class="n">assert</span><span class="p">.</span><span class="n">is_nil</span><span class="w"> </span><span class="n">list</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span></code></pre>

</div>
</div>
